<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	String name = (String)session.getAttribute("username");
	String email = (String)session.getAttribute("email");
	session.removeAttribute("username");
	session.removeAttribute("email");
	if(name == null){
	%>
		<script type="text/javascript">
			function openWindow(){
				window.alert('您好！芳芳欢迎您！请注册~');
			}
		</script>
	<%
	}else{
		if(email == null&& name != null){
			%>
			<script type="text/javascript">
			function openWindow(){
				window.alert('此用户名已经被注册');
			}
			</script>
			<%
		}else{
		%>
		<script type="text/javascript">
			function openWindow(){
				window.alert('此邮箱均已经被注册');
			}
		</script>
		<%
		}
	}
	//判断是否是登录失败
	if(session.getAttribute("ERROR") != null){
		%>
		<script type="text/javascript">
			function openWindow(){
				window.alert('对不起！由于系统繁忙，此次注册失败！');
			}
		</script>
		<%
		session.removeAttribute("ERROR");
	}
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
 	 <link rel="shortcut icon" href="images/favicon.ico"/>
    <base href="<%=basePath%>">
    <title>欢迎注册视频点播系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style>
    	body{background:#ccc; margin:0; padding:0; font-size:12px;}
		li{list-style:none;}
		#maindiv{width:1002px; height:150px; margin:auto; padding:0; border:#FFF 2px solid;color:#CCC; background:#666;}
		#maindiv h2,h1{margin-left:50px;}
		#signin{ background:#666;width:1002px; height:500px; margin:auto; padding:0; border-left:#FFF 2px solid; border-right:#FFF 2px solid; border-bottom:#FFF 2px solid;}
		#top{height:50px; background:#666;}
		#signinForm{margin:auto; padding:0; background:#FFF; width:802px; height:400px;}
		#signinForm ul{padding:20px; margin-left:20px;}
		#signinForm ul li{margin-top:10px; padding:0;}
		#agree{width:80px;}
		#signinForm ul li img{width:80px; height:20px; margin:auto 20px; padding:0;}
		#sub{background:url(images/buttun.png); width:95px; height:40px; border:none; font-size:16px; font-weight:800; margin-top:40px;}
    </style>
    
    <script type="text/javascript" src="js/signincheck.js"></script>
  </head>
  
  <body onLoad="openWindow()">
  		<div id="maindiv">
        	<h2>欢迎加入我们的大家庭</h2>
        	<h1>电信视频在线点播</h1>
        </div>
        <div id="signin">
        	<div id="top"></div>
        	<div id="signinForm">
            	<form action="sign" id="signinform" method="post">
                	<ul>
                        <li><span>账号：&nbsp;&nbsp;&nbsp;&nbsp;</span><input type="text" name="username" id="username"/>
                        <span id="namecheck" >* &nbsp; 6~14个字符和数字</span></li>
                        
                        <li><span>密码：&nbsp;&nbsp;&nbsp;&nbsp;</span><input type="password" name="password" id="password"/>
                        <span id="pwcheck">* &nbsp; 6~8个字符和数字</span></li>
                        
                        <li><span>确认密码：</span><input type="password" name="pwagain" id="pwagain"/></li>
                        
                        <li> <input type="radio" value="男" checked="checked" id="boy" onClick="boychecked()" /><span>男</span>&nbsp;&nbsp;&nbsp;
                        <input value="女" type="radio" id="girl" onClick="girlchecked()" /><span>女</span>
                        <input type="text" style="display:none;" value="boy" id="gender" name="gend"/></li>
                        
                        <li><span>E-mail：&nbsp;&nbsp;</span><input type="text" name="email" id="email"/>
                        <span id="emailcheck"></span></li>
                       
                        <li><input type="checkbox" checked="checked" name="agree" id="agree"/><a href = ""><span>阅读并同意注册协议</span></a></li>
                        <!--<li><input type="text" name="agree" id="agree" max="8" maxlength="10"/><img/></li>-->
                        <li><input type="button" value="注册" id="sub" onClick="check()"/></li>
                	</ul>
                </form>
            </div>
        </div>
  </body>
</html>
